#ifndef VASH_UI_HEADER
	#define VASH_UI_HEADER
	#include "Database.h"
	#include "Enviroment.h"
	#include "LineBuffer.h"
	#include <ncurses.h>

	class Ui
	{
		public:
			Ui(Database * db,Enviroment * env);
			void display();
			void drawSeperator(int inpt_size);
			int drawInput();
			void drawOutput(int size);
			void drawAutocomplete(int y);
			void useGlobalHist(bool glob);
			std::string readLine();
			~Ui();
		private:
			enum DispatchResults
			{
				Invalid,
				Success,
				ExecCmd
			};
			DispatchResults dispatchUiEvent(int event);
			enum LastArrow
			{
				None,
				Down,
				Up,
				Left,
				Right
			}last_arrow;
			enum InputModes
			{
				Single,			//Single Line mode.
				Multi,			//Multiple Lines mode.
				Interactive,	//Interactive,when running application on foreground.
				Modes
			}inpt_mode;
			Database * db;
			Enviroment * env;
			LineBuffer lb;
			ValueTable * autocomp;
			int autocomp_sel;
			int split_h;
			int max_inpt_h;
			size_t max_autocomp;
			std::string outpt_fld;
			WINDOW * inpt_win;
			WINDOW * outpt_win;
	};
#endif